home *** CD-ROM | disk | FTP | other *** search
- GIFLS
- version 1.2, portable
- 11/16/89
- by James W. Birdsall
-
- GIF and "Graphic Interchange Format" are trademarks (tm) of
- CompuServe, Inc., an H&R Block company.
-
-
- This program vaguely resembles the Unix utility ls, in that it
- provides a listing of GIF files and some pertinent information
- about them. The format is also after ls.
-
- Usage: gifls [-chlswf] [target] [target target...]
- If no target is given, GIFLS will scan the current directory.
- Valid targets are directory names, filenames (including paths), or
- filenames (including paths) with wildcards. Target types may be
- mixed. For example, if there is a directory \GIF which contains
- files ALBERT.GIF, ALIEN.GIF, and BORA.GIF, then
- GIFLS \gif will list all of them.
- GIFLS \gif\albert.gif will list ALBERT
- GIFLS \gif\a*.* will list ALBERT and ALIEN
- GIFLS \gif\*r* will list ALBERT and BORA
-
-
- The options are as follows:
-
- -c[l|g]nnn where l = less than
- g = greater than
- nnn = number
- causes a selective search based on number of colors in the
- GIF file. If neither l nor g is specified, GIFLS searches
- for files with exactly nnn colors.
-
- -h[l|g]nnn as above
- causes a selective search based on the height of the image
-
- -l
- causes a complete analysis of each file (subject to above
- searches)
-
- -s
- prints a line for every file, including non-GIF files
-
- -w[l|g]nnn as above
- causes a selective search based on the width of the image
-
- -f
- used for front end for GIFSTRIP and GIFCOLOR. Prints out a list
- of filenames (according to any specified searches) on stdout.
- Discards rest of output. Ignores -l and -s flags.
-
-
-
- Any option may be combined with any other option. However, if more
- than one of the same kind of search is used, then only the last one
- of that kind on the line will have any effect.
-
-
-
-
- WHAT THE OUTPUT MEANS:
-
- WITHOUT the -l option:
-
- G 30208 320 x 200 @ 256 \temp\YAR.GIF
-
- "G" means that the file has a global color map (blank if none).
- The next columns are the size (in bytes) of the file, the
- width and height of the screen raster (in pixels), and the
- number of colors in the image based on the number of bits per
- pixel (which, according to strict interpretation of the GIF
- specs, is wrong, but the field which is supposed to tell how
- many colors is usually set to a random number in most files!).
- The last column is the filename, including path.
-
-
- WITH the -l option: (three lines of output in this example)
-
- G- 30208 320 x 200 @ 256 C4 P8 B0 \temp\YAR.GIF
- GS 29215BY 115BL C8 320 x 200 @ 256 0L 0T
- GIF terminator and extra characters
- ----------
-
- LINE 1:
- G- 30208 320 x 200 @ 256 C4 P8 B0 \temp\YAR.GIF
-
- "G" means that the file has a global color map (blank if none).
- "-" means that bit 3 of byte 5 of the screen descriptor is set
- correctly (to 0); otherwise "B" is displayed.
- The next columns are the size (in bytes) of the file, the
- width and height of the screen raster (in pixels), and the
- number of colors in the image based on the number of bits per
- pixel (which, according to strict interpretation of the GIF
- specs, is wrong, but the field which is supposed to tell how
- many colors is usually set to a random number in most files!).
- The next column "C4" means that there are (supposedly) four
- bits of color data per pixel (this is the field that is set
- randomly in most files), where "C" stands for "Color bits."
- "P8" means that there are eight bits per pixel, where "P"
- stands of "Pixel bits." "B0" means that the background color
- is color index 0 in the applicable color map, where "B" stands
- for "Background." The last column is the filename, with path.
-
- The following lines indicate data about each individual image
- and/or extension block found in the GIF file. While most files
- only contain one image and no extension blocks, the GIF spec
- provides for multiple images and extension blocks within one
- file. The example file contains only one image and no extension
- blocks.
-
-
- LINE 2:
- GS 29215BY 115BL C8 320 x 200 @ 256 0L 0T
-
- The "G" means that this image uses the global color map instead
- of a local color map ("L"). "S" means that the image is stored
- sequentially instead of in interlaced format ("I"). The next
- two columns are the number of bytes ("BY") in the compressed
- image, and the number of blocks ("BL") these bytes are
- formatted in. "C8" means that there are eight bits of color
- data per pixel in this image, where "C" stands for "Color
- bits." The next columns are the width and height of the image
- (in pixels), which is usually but not always the same as the
- screen raster, and the colors in the image (based on the bit
- count). The last two columns are the coordinates of the upper
- left corner of the image within the screen raster, where "L"
- is the horizontal coordinate (stands for Left side) and "T" is
- the vertical coordinate (stands for Top), and where all
- coordinates are in pixels measured from an origin at the top
- left corner of the screen raster.
-
- The format of an extension block is as follows:
- Extension: func nnn xxxxxxxxBY yyyyyBL
- where nnn is the function number, x the number of bytes in the
- extension block, and y the number of blocks within it.
-
- LINE 3:
- The final (informative) line of the output is always either
- GIF terminator and nnn extra characters
- or
- GIF terminator
- The first means that the file has probably been transferred
- using a protocol such as XMODEM, which leaves spurious
- characters on the end of the file. It means just that; that
- there are spurious characters in the file after the GIF
- terminator character. The second means that the GIF terminator
- character is the last character in the file, which is good.
-
- And the last line is always:
- ----------
-
- So, for this example, the whole thing looks like:
- G- 30208 320 x 200 @ 256 C4 P8 B0 \temp\YAR.GIF
- GS 29215BY 115BL C8 320 x 200 @ 256 0L 0T
- GIF terminator and extra characters
- ----------
-
-
-
- GIFLS can be used as a front end for GIFSTRIP and GIFCOLOR. When the -f
- option is used, GIFLS prints out a list of filenames according to any searches
- (-w, -h, -c) specified on the command line. This list can be piped in to
- GIFSTRIP or GIFCOLOR. When these programs detect that their stdin has been
- redirected, they parse their command lines for options and then read targets
- from stdin ONLY.